﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DuelQuizz.contract;
using DuelQuizz.DuelQuizzServiceReference;
using DuelQuizz.Views;

namespace DuelQuizz
{
    /// <summary>
    /// Logique d'interaction pour MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public static MainWindow main_windows;

        public MainWindow()
        {
            AppServices.getDuelQuizzServices().ServiceConnection();

            InitializeComponent();
            main_windows = this;

            LoginUserControl login = new LoginUserControl();
            //Quiz login = new Quiz();

            Grid.SetRow(login, 0); 
            Grid.SetColumn(login, 0); 

            MainView.Children.Add(login);
        }

        public static void changeWindows(UserControl window)
        {
            main_windows.MainView.Children.Clear();
            Grid.SetRow(window, 0);
            Grid.SetColumn(window, 0);

            main_windows.MainView.Children.Add(window);
        }

        private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e)
        {
            AppServices.getDuelQuizzServices().ServiceDeconnectionAsync();
        }


    }
}
